package pl.elka.simulator.gui.swt;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

import pl.elka.simulator.core.configurationCommand.ConfigurationCommandType;
import pl.elka.simulator.mediator.ActionType;
import pl.elka.simulator.mediator.ActionValue;
import pl.elka.simulator.mediator.SimulationFasade;



public class CommandSelectedListener extends SelectionAdapter {

	private final ConfigurationCommandType commandType;
	private final String mobilityManagerId;
	
	public CommandSelectedListener(ConfigurationCommandType commandType,String mmId){
		this.commandType = commandType;
		this.mobilityManagerId = mmId;
	}
	
	@Override
	public void widgetSelected(SelectionEvent e) {
		SimulationFasade.getInstance().handleAction(ActionType.BeginConfigurationParamCreation, new ActionValue(new Object[]{commandType,mobilityManagerId}));
	}
}
